package com.huaxin.hxmoduleworkorder.controller;

import com.huaxin.feignclient.system.SystemClient;
import com.huaxin.feignclient.system.models.ElectricianScopeDTO;
import com.huaxin.hxmoduleworkorder.dto.ResponseCode;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "测试fegin")
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/workorder/testFeign")
public class TestFeignController {
    private final SystemClient systemClient;

    @GetMapping("/test")
    public void test() {
        com.huaxin.feignclient.models.ResponseResult<List<ElectricianScopeDTO>> result = systemClient.electricianScopeList(null);
        if (result.getCode() != ResponseCode.SUCCESS.getCode() || result.getData() == null) {

            return;
        }
        List<ElectricianScopeDTO> electricianScopes = (List<ElectricianScopeDTO>) result.getData();
        if (electricianScopes.isEmpty()) {
            return;
        }
    }
}
